package allrobots.Robot;

import t10086.Data.Map.TextCoordinate;
import t10086.Data.Robot.RobotInfo;
import t10086.Data.Robot.RobotStatus;

import java.net.InetSocketAddress;
import java.util.Stack;

public class RobotMessage {
    private String serialNum;
    private TextCoordinate position;//当前位置
    private TextCoordinate next;//下一个希望去的位置
    private TextCoordinate termination;//本次的终点
    private int window;//排队窗口
    private RobotStatus robotStatus;//当前状态
    private InetSocketAddress listenedSocket;//机器人的等待接入ip
    private long selfMovingNumber;//移动序列号
    private long selfQueuingNumber;//排队序列号;
    private String order;
    private TextCoordinate bornPosition;
    public long startTime;

    public RobotMessage(String serialNum,int window,TextCoordinate position, TextCoordinate next, TextCoordinate termination, RobotStatus robotStatus, InetSocketAddress listenedSocket, long selfMovingNumber, long selfQueuingNumber,TextCoordinate bornPosition) {
        this.serialNum=serialNum;
        this.position = position;
        this.next = next;
        this.termination = termination;
        this.robotStatus = robotStatus;
        this.listenedSocket = listenedSocket;
        this.selfMovingNumber = selfMovingNumber;
        this.selfQueuingNumber = selfQueuingNumber;
        this.window=window;
        this.bornPosition=bornPosition;
    }

    public TextCoordinate getBornPosition() {
        return bornPosition;
    }

    public void setBornPosition(TextCoordinate bornPosition) {
        this.bornPosition = bornPosition;
    }

    public RobotMessage() {
    }

    public int getWindow() {
        return window;
    }

    public void setWindow(int window) {
        this.window = window;
    }

    public String getSerialNum() {
        return serialNum;
    }

    public void setSerialNum(String serialNum) {
        this.serialNum = serialNum;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public void changeInfo(RobotInfo robot){
        position=robot.getPosition();
        next=robot.getNext();
        termination=robot.getTermination();
        robotStatus=robot.getRobotStatus();
        listenedSocket=robot.getListenedAddress();
        selfMovingNumber=robot.getSelfMovingNumber();
        selfQueuingNumber= robot.getSelfQueuingNumber();
    }

    public TextCoordinate getPosition() {
        return position;
    }

    public void setPosition(TextCoordinate position) {
        this.position = position;
    }

    public TextCoordinate getNext() {
        return next;
    }

    public void setNext(TextCoordinate next) {
        this.next = next;
    }

    public TextCoordinate getTermination() {
        return termination;
    }

    public void setTermination(TextCoordinate termination) {
        this.termination = termination;
    }

    public RobotStatus getRobotStatus() {
        return robotStatus;
    }

    public void setRobotStatus(RobotStatus robotStatus) {
        this.robotStatus = robotStatus;
    }

    public InetSocketAddress getListenedSocket() {
        return listenedSocket;
    }

    public void setListenedSocket(InetSocketAddress listenedSocket) {
        this.listenedSocket = listenedSocket;
    }

    public long getSelfMovingNumber() {
        return selfMovingNumber;
    }

    public void setSelfMovingNumber(long selfMovingNumber) {
        this.selfMovingNumber = selfMovingNumber;
    }

    public long getSelfQueuingNumber() {
        return selfQueuingNumber;
    }

    public void setSelfQueuingNumber(long selfQueuingNumber) {
        this.selfQueuingNumber = selfQueuingNumber;
    }
}
